<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>success</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

</head>
<body>
    <h2 th:text="${username}"></h2>

    <h3>登录成功</h3>
    <div>
        <button class="btn btn-secondary" onclick="away()">登出</button>
    </div>

    <div>
        <table>
            <caption>亲戚信息</caption>
            <thead>
            <tr>
                <th>关系</th>
                <th>姓名</th>
                <th>年龄</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="person:${relative}">
                <td th:text="${person.relationship}"></td>
                <td th:text="${person.name}"></td>
                <td th:text="${person.age}"></td>
            </tr>
            </tbody>
        </table>
    </div>
    <script>
        function away() {
            window.location.href="/user";
        }
    </script>

</body>
</html>